package com.ht.service;

import java.util.List;

import com.ht.bean.Pager;
import com.ht.bean.Pager4EasyUI;
import com.ht.bean.Product;
import com.ht.dao.ProductDAO;
import com.ht.dao.ProductDAOImpl;

public class ProductServiceImpl implements ProductService {

	private ProductDAO productDAO;

	public ProductServiceImpl() {
		productDAO = new ProductDAOImpl();
	}

	@Override
	public Product add(Product product) {
		return productDAO.add(product);
	}

	@Override
	public Product query(String id) {
		return productDAO.query(id);
	}

	@Override
	public List<Product> queryAll() {
		return productDAO.queryAll();
	}

	@Override
	public void remove(String id) {
		productDAO.remove(id);
	}

	@Override
	public Product update(Product product) {
		return productDAO.update(product);
	}

	@Override
	public Pager<Product> queryByPage(int pageNo, int pageSize) {
		return productDAO.queryByPager(pageNo, pageSize);
	}

	@Override
	public Pager4EasyUI<Product> paging(int pageNo, int pageSize) {
		return productDAO.paging(pageNo, pageSize);
	}

}
